﻿using System;
using System.Windows.Forms;
using Kaleida.ServiceMonitor.Model.Runtime;

namespace Kaleida.ServiceMonitor.UI
{
    public class NotificationPanelTabPage : TabPage
    {
        private readonly Type type;

        public NotificationPanelTabPage(Type panelType)
        {
            type = panelType;
            Text = panelType.GetPanelName();
        }

        public Type Type
        {
            get { return type; }
        }

        public void SetPanel(INotificationPanel panel)
        {
            var panelControl = panel.GetPanelControl();
            panelControl.Dock = DockStyle.Fill;
            Controls.Clear();
            Controls.Add(panelControl);
        }
    }
}
